package com.boot.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController //@Controller
public class IndexController {

    //因为SpringBoot将application.yml/properties配置自动加载
    //所以我们可以字节使用
    @Value("${server.port}")
    Integer port;

    @GetMapping("/index")
    public String index(){
        return "index:"+port;
    }

}
